import java.util.Random;
import java.util.Scanner;

public class Text {


    //方法
    public static boolean isLeapYear(int year){
        if((year % 100 != 0 && year % 4 == 0) || year % 400 == 0){
            //System.out.println(year + "是闰年");
            return true;
        }
        return false;
    }

    public static int add(int a,int b){//形式参数

        return a+b;
    }

    public static void main(String[] args) {


        int ret = add(1,2);
        //实参.   个数匹配，类型匹配；
        System.out.println(ret);


    }




    public static void main8(String[] args) {
        Scanner in = new Scanner(System.in);
        int year = in.nextInt();

        if((year % 100 != 0 && year % 4 == 0) || year % 400 == 0){
            System.out.println(year + "是闰年");
        }
    }



    public static void main7(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的姓名");
        String name = scanner.next();

    }





    public static void main6(String[] args) {
        Random random = new Random();
        int num = random.nextInt(100);
        Scanner scan = new Scanner(System.in);


        while(true){
            System.out.println("请输入你要猜的数字");
            int i = scan.nextInt();
            if(i > num){
                System.out.println("猜大了！");
            }else if(i == num){
                System.out.println("猜对了！");
                break;
            }else{
                System.out.println("猜小了！");
            }

        }

    }


    public static void main5(String[] args) {
        double sum = 0;
        int f = 1;
        for (int i = 1; i < 100; i++) {
            sum = sum + 1.0/i * f;
            f = -f;
        }
        System.out.println(sum);
    }


    public static void main4(String[] args) {
        int i = 20;
        int j = 40;
        int k = i % j;
        while(k != 0){
            i = j;
            j = k;
            k = i % j;
        }
        System.out.println(j);
    }


    public static void main3(String[] args) {
        int year = 1000;
        for (year = 1000; year <= 2000 ; year++) {
            if(year % 4 == 0 && year % 100 != 0){
                System.out.println(year + "是闰年");
            }else if(year % 400 == 0){
                System.out.println(year + "是闰年");
            }

        }
    }




    public static void main2(String[] args) {
        int i = 1;
        for (i = 1; i <=100; i++) {
            System.out.println(i);

        }
    }


    public static void main1(String[] args) {
        int count = 0;
        for (int i = 1; i <100 ; i++) {
            if(i % 10 == 9){
                count++;
            }
            if(i / 10 == 9) {
                count++;
            }
        }
        System.out.println(count);
    }
}
